<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>修改巡检单位及月份</title>
<script type="text/javascript" src="plug-in/jquery/jquery-1.8.3.js"></script>
<script type="text/javascript" src="plug-in/tools/curdtools_zh-cn.js"></script>
<script type="text/javascript" src="plug-in/Highcharts-4.2.4/highcharts.js" ></script>
<script type="text/javascript" src="plug-in/easyui/jquery.easyui.min.1.3.2.js"></script>
<script type="text/javascript" src="plug-in/lhgDialog/lhgdialog.min.js"></script>
<link rel="stylesheet" href="plug-in/easyui/themes/default/easyui.css" type="text/css"></link>
<link rel="stylesheet" href="plug-in/easyui/themes/icon.css" type="text/css"></link>
<link rel="stylesheet" href="plug-in/tools/css/common.css" type="text/css"></link>
<script type="text/javascript" src="plug-in/ckfinder/ckfinder.js"></script>
<script type="text/javascript">
$(function(){
	var hgsData = $.parseJSON('${hgs}');
	var hgs = new Array();
	for(var index in hgsData){
		var hg = {};
		hg.name = hgsData[index].name;
		hg.data = hgsData[index].data;
		hg.stack = hgsData[index].stack;
		hgs.push(hg);
	}
	initallHighChartsOfPillar(hgs);
	var cmMonthIsAdjustment = $.parseJSON('${cmMonthIsAdjustmentMap}');
	$.each(cmMonthIsAdjustment,function(key,value){
		if(!value){
			$("input[name='cIpMonth'] :eq("+(key-1)+")").parent().css("color","red").before('<span style="color:red;display:block;margin-left:-15px;">不可调整</span>');
		}
	});
	
	
});
function initallHighChartsOfPillar(serData){
	$("#highchartContainerOfPillar").highcharts({
		credits: {//去水印
         	text: '',
         	href: ''
     	},
        chart: {
            type: 'column'
        },
        title: {
            text: ''
        },
        plotOptions: {
            column: {
            	stacking: 'normal'
            }
        },
        tooltip: {
        	formatter: function () {
                return '<b>' + this.x + '</b><br/>' +
                    this.series.name + ': ' + this.y;
            }
        },
        xAxis: {
        	categories: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
            crosshair: true
        },
        yAxis: {
            min: 0,
            title: {
                text: ''
            }
        },
        legend: {
            enabled: false
        },
        series : serData
    });
}
</script>
</head>
<body style="padding: 10px;margin: 0px auto;">
	<t:formvalid action="cbsEsPlanIpController.do?doUpdate" dialog="true" formid="updateCip" layout="table" callback="updateCipCallBack">
		<input type="hidden" value="${cmId }" name="cmId" />
		<input type="hidden" value="${source }" name="source" />
		<input type="hidden" value="${ipCompany }" name="ipCompany" />
		<input type="hidden" value="${ipMonth }" name="ipMonth" />
		<div class="pad_l_10">
			<table width="100%">
				<tr>
					<td>影院名称: ${cmName }</td>
					<td>巡检数量: ${ipCount }</td>
					<td>巡检月份: ${ipMonth }</td>
					<td>巡检服务商:
						<select name="cIpCompany" style="width: 260px;">
							<c:forEach items="${tpTsDeparts }" var="item">
								<option value="${item.id }" <c:if test="${item.id eq ipCompany}">selected="selected"</c:if>>${item.departname }</option>
							</c:forEach>
						</select>
					</td>
				</tr>
				<tr>
					<td colspan="4">
						<div id="highchartContainerOfPillar" style="width: 99%;height:500px;margin-top:20px;"></div>
					</td>
				</tr>
				<tr>
					<td colspan="4">
						<c:forEach begin="1" end="12" var="item" varStatus="vs">
							<div style="<c:if test="${vs.index  eq 1 }" >margin-left:66px;</c:if>width:77.5px;display: inline-block;">
								<label><input type="radio" name="cIpMonth" value="${item }" <c:if test="${item eq ipMonth}">checked="checked"</c:if> />${item }</label>
							</div>
						</c:forEach>
					</td>
				</tr>
			</table>
		</div>
	</t:formvalid>
</body>
